package com.nbsaas.boot.order.rest.convert;

import com.nbsaas.boot.order.data.entity.OrderLog;
import com.nbsaas.boot.order.api.domain.response.OrderLogResponse;

import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
/**
* 实体对象转化成响应对象
*/

public class OrderLogResponseConvert  implements Converter<OrderLogResponse,OrderLog> {

    @Override
    public OrderLogResponse convert(OrderLog source) {
        OrderLogResponse  result = new  OrderLogResponse();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getOrder()!=null){
                        result.setOrder(source.getOrder().getId());
                    }
        return result;
    }

}

